<?php

namespace Biz\model\store;

use Doraemon\pockets\datebase\BaseDbModel;

class MStoreContent extends BaseDbModel
{
    const _CONFIG_FILE_ = 'db_store';

    const _CONFIG_SELECT_ = 'db_store';

    const _DATABASE_ = 'store';

    const _TABLE_NAME = 'store_content';

    const CONTENT_MODULE_ALL = 0; //全部
    const CONTENT_MODULE_USER = 1; //住友说
    const CONTENT_MODULE_DESIGNER = 2; //设计师说
    const CONTENT_MODULE_STORE = 3; //门店动态

    const CONTENT_STATUS_ALL = 0; //全部
    const CONTENT_STATUS_SUCCESS = 1; //已收录
    const CONTENT_STATUS_CANCEL = 2; //取消收录
    const CONTENT_STATUS_DELETE = 3; //删除
    const CONTENT_STATUS_USER_DELETE = 4; //关联删除
    const CONTENT_STATUS_MAP = [
        self::CONTENT_STATUS_SUCCESS => '已收录',
        self::CONTENT_STATUS_CANCEL => '已取消收录',
    ];

    const CONTENT_TYPE_ALL = 0; //全部
    const CONTENT_TYPE_ARTICLE = 1; //整屋
    const CONTENT_TYPE_BLANK = 2; //文章
    const CONTENT_TYPE_PHOTO = 3; //图片
    const CONTENT_TYPE_VIDEO = 4; //视频

    const CONTENT_TYPE_MAP = [
        self::CONTENT_TYPE_ALL => '全部',
        self::CONTENT_TYPE_BLANK => '文章',
        self::CONTENT_TYPE_PHOTO => '图片',
        self::CONTENT_TYPE_VIDEO => '视频',
    ];

    const CONTENT_FROM_RELATE = 1; //关联门店
    const CONTENT_FROM_WIKI = 2; //关联WIKI
    const CONTENT_FROM_TAG = 4; //关联点图标签
    const CONTENT_FROM_AUTO = 8; //手动关联
    const CONTENT_FROM_OWNER = 16; //门店发布

    public static function getInfo($id)
    {
        return self::get("*", [
            "AND" => [
                'id' => $id,
            ],
        ]);
    }
}